package view.option;

import java.util.ArrayList;
import model.DataManager;

/**
 * 
 * @author Michael Deng
 *
 */
public class PieData extends AbstractOption {

    private final String myGraphType = "PieChart";
    private DataManager myModel;
    private String mySchool;

    @Override
    public void execute () {
        myModel = super.getModel();
        mySchool = super.getSchool();
        super.execute();
        myModel.resetWorkspace();
        myModel.dataAction("Season", "AddColumn", null);
        myModel.dataAction("W", "AddColumn", null);
        myModel.dataAction("School", "AddColumn", null);
        ArrayList<String> ref = new ArrayList<String>();
        ref.add(mySchool);
        myModel.dataAction("School", "DeleteRowOnNotEqual", ref);
        myModel.dataAction("School", "DeleteColumn", null);
        myModel.dataAction(null, "PercentifyTable", null);

        visualize(myGraphType);
    }
}
